package com.wsoft.hr.pm.manager;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wsoft.core.service.RedisService;
import com.wsoft.hr.pm.entity.HrPmTemplateScopeEntity;
import com.wsoft.hr.pm.mapper.HrPmTemplateScopeMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author z001
 * @Date 2025年02月17日 15:06:35
 */
@Slf4j
@Service
public class HrPmTemplateScopeManager extends ServiceImpl<HrPmTemplateScopeMapper, HrPmTemplateScopeEntity> {

    @Resource
    private RedisService redisService;

    /**
     * 根据模版id 获取信息
     * @param templateId
     * @return
     */
    public List<HrPmTemplateScopeEntity> getByTemplateId(Long templateId) {
        QueryWrapper<HrPmTemplateScopeEntity> query = new QueryWrapper<>();
        query.lambda().eq(HrPmTemplateScopeEntity::getTemplateId,templateId);
        return list(query);
    }
}
